//
//  PYSystemTool.h
//  IHome
//
//  Created by Jim on 2019/3/16.
//  Copyright © 2019 com.zhujizheng. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface PYSystemTool : NSObject

#pragma mark - 系统版本
/// 是否低于某个iOS系统版本 <
+ (BOOL)isBelowSystemVersion:(CGFloat)systemVersion;
/// 是否高于某个iOS系统版本 >=
+ (BOOL)isAboveSystemVersion:(CGFloat)systemVersion;

#pragma mark - 设备类型
/// 是否时刘海屏，iPhoneX以后
+ (BOOL)isIPhoneXOrLater;
/// 是否是iPad
+ (BOOL)isIPad;
/// 是否时iPhone
+ (BOOL)isIPhone;
/// 是否是模拟器
+ (BOOL)isSimulator;
/** 获取设备名称 */
+ (const NSString *)getDiviceName;
/** 获取设备电池容量，单位 mA 毫安 */
+ (NSInteger)getBatteryCapacity;
/** 获取电池电压，单位 V 福特 */
+ (CGFloat)getBatterVolocity;
/** 获取CPU处理器名称 */
+ (const NSString *)getCPUProcessor;
#pragma mark - 状态栏
/// 显示defaultStyle的状态栏
+ (void)showDefaultStatus;
/// 显示白色状态栏
+ (void)showLightStatus;
/// 显示defaultStyle的状态栏，带动画
+ (void)showDefaultStatusWithAnimation;
/// 隐藏状态栏，带动画
+ (void)hideStatusWithAnimation;
/// 隐藏状态栏，不带动画
+ (void)hideStatus;
/// 显示状态栏，不带动画
+ (void)showStatus;

#pragma mark - 设备方向
/// 强制改变屏幕方向
+ (void)rotateDeviceToOrientation:(UIDeviceOrientation)deviceOrientation;

#pragma mark - present控制器
/// 封装系统present方法，提供可用于present的控制器
+ (void)presentViewController:(__kindof UIViewController *)viewController;
+ (void)presentViewController:(__kindof UIViewController *)viewController animated:(BOOL)animated completion:(nullable void (^)(void))completion;

#pragma mark - 系统相机、系统相册、自定义相机、自定义相册
/// 调用相机
+ (void)presentSystemCamera:(nullable void(^)(UIImage *image))imgBlock;
+ (void)presentSystemCamera:(nullable void(^)(UIImage *image))imgBlock
           videoBlock:(nullable void (^)(UIImage *thumbnailImg, NSURL *videoURL))videoBlock;
/// 调用相册
+ (void)presentSystemAlbum:(nullable void (^)(UIImage *image))imgBlock;
+ (void)presentSystemAlbum:(nullable void (^)(UIImage *image))imgBlock
          videoBlock:(nullable void (^)(UIImage *thumbnailImg, NSURL *videoURL))videoBlock;

#pragma mark - 判断系统时间是不是24小时制
+ (BOOL)is24Hour;

#pragma mark - 暂不支持此功能
+ (void)showDevelopingAlert;

#pragma mark - 时间
/// 获取当前系统时间，精度为毫秒
+ (long)systemTime;

#pragma mark - 测试代码运行时间
/// 开始测试
+ (void)beginTest;
/// 结束测试，并打印代码运行时间，单位为毫秒
+ (void)endTest;

#pragma mark - NSUserDefaults
/// 存储bool值
+ (void)setBool:(BOOL)boolvalue forKey:(id)key;
/// 获取bool值
+ (BOOL)getBoolValueForKey:(id)key;
/// 存储dict值
+ (void)setDict:(NSDictionary *)dict forKey:(id)key;
/// 获取dict值
+ (nullable NSDictionary *)getDictByKey:(id)key;

#pragma mark - App相关
/// YES 从TestFlight下载，NO 不是从TestFlight下载
+ (BOOL)isAppFromTestFlight;
/// YES 从AppStore下载，NO 不是从AppStore下载
+ (BOOL)isAppFromAppStore;
/// 获取App名字
+ (NSString *)getAppName;
/// 获取App版本号
+ (NSString *)getAppVersion;
/// 获取Appid
+ (NSString *)getAppID;
/// 更新App
+ (void)updateApp:(NSString *)appDownloadUrl;
/// 蒲公英更新
+ (void)updateAppFromDandelion;
#pragma mark - 跳转到其他应用
/// 跳转到TestFlight
+ (void)gotoTestFlight;
/// 跳转到AppStore
+ (void)gotoAppStore;
/// 跳转到系统设置
+ (void)gotoSystemSetting;

#pragma mark - 堆栈信息
+ (void)logStackInfo;

#pragma mark - 打印所有苹果自带字体
+ (void)printAllAppleFont;

#pragma mark - 生成钱格式的字符串
+ (NSString *)generateMoneyStringWithDecimalNumber:(NSDecimalNumber *)decimalNumber;

@end

NS_ASSUME_NONNULL_END
